package team.kirohuji.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.commons.lang.StringUtils;
import org.apache.shiro.crypto.RandomNumberGenerator;
import org.apache.shiro.crypto.SecureRandomNumberGenerator;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import team.kirohuji.dao.AfficheDao;
import team.kirohuji.domain.Affiche;
import team.kirohuji.service.AfficheService;
import team.kirohuji.utils.ShiroUtils;

/**
 * 系统用户服务实现类
 * @author kirohuji
 *
 */
@Service("afficheService")
public class AfficheServiceImpl implements AfficheService {

    /**
     * @see AfficheDao
     * AfficheDao
     */
    @Resource
    private AfficheDao AfficheDao;
   
    /* 
     * 查询一条记录通过用户Id
     * (non-Javadoc)
     * @see team.kirohuji.service.AfficheService#queryObject(java.lang.Integer)
     * @param userId 用户主键
     * @return Affiche
     */
    @Override
    public Affiche queryObject(Integer afficheId) {

        return AfficheDao.queryObject(afficheId);
    }

    /* 
     * 查询一组记录
     * (non-Javadoc)
     * @see team.kirohuji.service.AfficheService#queryList(java.util.Map)
     * @param map map对象
     * @return Affiche列表
     */
    @Override
    public List<Affiche> queryList(Map<String, Object> map) {

        return AfficheDao.queryList(map);
    }

    /* 
     * 查询全部
     * (non-Javadoc)
     * @see team.kirohuji.service.AfficheService#queryTotal(java.util.Map)
     * @param map map对象
     * @return int
     */
    @Override
    public int queryTotal(Map<String, Object> map) {

        return AfficheDao.queryTotal(map);
    }

    /* 
     * 存入一条记录
     * (non-Javadoc)
     * @see team.kirohuji.service.AfficheService#save(team.kirohuji.domain.Affiche)
     * @param user 用户
     * @throws IllegalArgumentException 
     */
    @Override
    @Transactional
    public void save(Affiche affiche) throws IllegalArgumentException {
    	AfficheDao.save(affiche);
    }

    /* 
     * 更新
     * (non-Javadoc)
     * @see team.kirohuji.service.AfficheService#update(team.kirohuji.domain.Affiche)
     * @param user 用户
     * @throws IllegalArgumentException
     */
    @Override
    @Transactional
    public void update(Affiche affiche) throws IllegalArgumentException {
    	AfficheDao.update(affiche);
    }

    /* 
     * 批量删除
     * (non-Javadoc)
     * @see team.kirohuji.service.AfficheService#deleteBatch(java.lang.Integer[])
     * @param userIds 用户主键数组
     */
    @Override
    @Transactional
    public void deleteBatch(Integer[] ids) {
        AfficheDao.deleteBatch(ids);
    }
}